<template>
  <div class="detail-container" v-loading="loading">
    <el-card shadow="never" style="margin-top: 15px;" class="detail-form">
      <div style="margin-top:20px">
        <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
        <span class="font-small">基本信息</span>
      </div>
      <el-form  size="mini" label-width="150px" style="margin-top:20px">
        <el-row>
          <el-col :span="8">
            <el-form-item label="单据编号：">{{orderInfo.entrySn}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单据日期：">{{orderInfo.createTime}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单据类型：">{{orderInfo.entryType}}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="供应商：">{{orderInfo.supplierName}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="合同公司：">{{orderInfo.fromCompany}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="合计数量：">{{orderInfo.entryGoodsNum}}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="合计金额：">{{orderInfo.entryGoodsAmount}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系人：">{{orderInfo.contactName}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="运费报销状态：">{{orderInfo.isFreightSettled == 0 ? '未报销' : '已报销'}}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="电话：">{{orderInfo.contactPhone}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="运费报销时间：">{{orderInfo.freightSettledTime}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务员：">{{orderInfo.userName}}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="备注：">{{orderInfo.entryRemark}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="加工商：">{{orderInfo.agentProcessor}}</el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div style="margin-top: 20px;clear: both">
        <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
        <span class="font-small">商品信息</span>
      </div>
      <el-table
        ref="orderItemTable"
        :data="orderInfo.entryGoodsList"
        style="width: 100%;margin-top: 20px;box-sizing: border-box" border>
        <el-table-column label="商品名称" width="150" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsName}}
          </template>
        </el-table-column>
        <el-table-column label="商品牌号" width="150" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsSn}}
          </template>
        </el-table-column>
        <el-table-column label="批号" width="150"  align="center">
          <template slot-scope="scope">
            {{scope.row.goodsBatchNo }}
          </template>
        </el-table-column>
        <el-table-column label="仓库" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsWarehouse}}
          </template>
        </el-table-column>
        <el-table-column label="单价" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsPrice}}
          </template>
        </el-table-column>
        <el-table-column label="数量" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsNum}}
          </template>
        </el-table-column>
        <el-table-column label="单位" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsUnit}}
          </template>
        </el-table-column>
        <el-table-column label="金额" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsAmount}}
          </template>
        </el-table-column>
        <el-table-column label="备注" width="150">
          <template slot-scope="scope">
            {{scope.row.goodsRemark}}
          </template>
        </el-table-column>
        <el-table-column label="交货日期" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsDeliveryDate}}
          </template>
        </el-table-column>
        <el-table-column label="源单编号" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.purchaseOrderSn}}
          </template>
        </el-table-column>
        <el-table-column label="预计发货地" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.goodsDeliveryCity}}
          </template>
        </el-table-column>
        <el-table-column label="原料采购订单号" width="150" align="center">
          <template slot-scope="scope">
            {{scope.row.materialOrderSn}}
          </template>
        </el-table-column>
        <el-table-column label="原料采购数量" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.materialGoodsNum}}
          </template>
        </el-table-column>
        <el-table-column label="原料采购价" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.materialPrice}}
          </template>
        </el-table-column>
        <el-table-column label="加工费" width="100" align="center">
          <template slot-scope="scope">
            {{scope.row.processingFee}}
          </template>
        </el-table-column>
      </el-table>
    </el-card>
    <!--放大图片-->
    <el-dialog
      :visible.sync="dialogVisible5"
      width="800">
      <img :src="fullSrc" style="width:100%"/>
    </el-dialog>

  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import store from '@/store'
import {agentProcessBillInfo,getCustomerSetting,deliverDeliverSet,deliverDeliverList,getOrderUsersList,entryDetail,setEntryDriver,setExpress,warehouseUpdatePrintNum} from '@/api/partner'
import {validateCommission} from '@/utils/validate';
import "@/utils/jQuery.print"
import zhoufei from '@/assets/images/zhuofei.png'
const defaultSendForm={
  deliverId: '',
  goodsReceipt: [],
  goodsReceiptRemark: '',
  goodsReceiptDate:'',
  goodsReceiptSrc:'',
};
const defaultSendTypeForm={
  sendType: '',
};
export default {
  name: "purchaseOEMInfo",
  data(){
    return{
      roles:store.getters.roles ? store.getters.roles : [],
      loading:false,
      deliverId:this.$route.query.id,
      type:this.$route.query.type,
      orderInfo:{},
      fullSrc:'',
      dialogVisible5:false
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'mobile',
      'userId'
    ]),
  },
  created() {
     this.getPageInfo();
  },
  filters: {

  },
  methods:{

    //放大图片
    fullImg(item){
      this.dialogVisible5 = true;
      this.fullSrc = item
    },


    //获取合同详情
    getPageInfo(){
      this.loading = true;
      agentProcessBillInfo({entryId:this.$route.query.id}).then(res=>{
        this.orderInfo = res;
        this.loading = false;
      });
    },

  }
}
</script>

<style  lang="scss" scoped>

</style>
